<script setup lang="ts">
const key = defineModel<number>({ required: true })
const options = shallowRef<{ key: string | number, value: string }[]>([
])

async function getList() {
  const res = await equipmentInfoApi.getEquipmentInfoList()
  options.value = (res.data ?? []).map((item: any) => ({
    key: +item.key,
    value: item.value,
  }))
}

onMounted(() => {
  getList()
})
</script>

<template>
  <ElSelect v-model="key" placeholder="请选择" v-bind="$attrs">
    <ElOption v-for="item in options" :key="item.key" :label="item.value" :value="item.key" />
  </ElSelect>
</template>
